<!DOCTYPE html>
<html lang="en">

<head>
    <include file="Home@default/Index/header"/>
    <link rel="stylesheet" href="__PUBLIC__/AmazeUI/assets/css/Login.app.css">
    <script src="__PUBLIC__/Jquery/Pulgin/jquery-1.9.1.js"></script>

</head>

<body data-type="login">
<script>
    $('body').attr('class', 'theme-white');
</script>
<div class="am-g tpl-g">
    <div class="tpl-login"  style="padding-bottom: 40px;">
        <div class="tpl-login-content">
            <div class="tpl-login-logo"></div>
            <form class="am-form tpl-form-line-form">
                <div class="am-form-group">
                    <input type="text" class="tpl-form-input" name="mobile" placeholder="请输入账号">
                </div>

                <div class="am-form-group">
                    <input type="password" class="tpl-form-input" name="password" placeholder="请输入密码">
                </div>

                <div class="am-form-group">
                    <input type="text" class="tpl-form-input" name="verify" placeholder="请输入验证码">
                </div>

                <div id="verify_img" class="am-form-group tpl-login-remember-me">
                    <img id="verify_src" style="width: 100%" onclick="verify_f5();" src="<{:U('Verify');}>">
                </div>

                <div class="am-form-group tpl-login-remember-me">
                    <input id="remember-me" type="checkbox">
                    <label for="remember-me">
                        记住密码
                    </label>
                </div>


                <div class="am-form-group">
                    <button type="button" id="submit"
                            class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">提交
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="__PUBLIC__/BeginnerAdmin/plugins/layer_mobile/layer.js"></script>
<include file="Home@default/Index/footer"/>

<script>
    function verify_f5() {
        $("#verify_src").attr('src', '<{:U('Verify');}>?r=' + Math.random());
    }

    $("#submit").click('onclick', function () {
        $(this).button('loading');
        $.AMUI.progress.start();
        $.post('<{:U('LoginVerify');}>', {
            mobile: $('input[name="mobile"]').val(),
            password: $("input[name='password']").val(),
            verify:$("input[name='verify']").val()
        }, function (data) {
            verify_f5();
            $("input[name='verify']").val('');
            if (data.code == 200){
                window.location = '<{:U('Student/Index');}>';
            }else{
                layer.open({
                    content: data.msg
                    ,btn: '我知道了'
                });
            }
            $.AMUI.progress.done();
        }, 'json');
        $(this).button('reset');
    });
</script>
</body>

</html>